#ifndef USART_CONFIG_H
#define USART_CONFIG_H

/*****************************LIBConfig*********************************/
#include "ht32f5xxxx_01.h"
#include "ht32f5xxxx_usart.h"
#define _USART_InitTypeDef     USART_InitTypeDef                                                    /*Check and edit it*/
#define _USART_Typedef         HT_USART_TypeDef                                                     /*Check and edit it*/
#define _USART_CreateInitStruct      \
                            _USART_InitTypeDef USART_InitStruct

#define _USART_BAUD         USART_BaudRate                                                          /*Check and edit it*/
#define _USART_STOP_BITS    USART_StopBits                                                          /*Check and edit it*/
#define _USART_PARITY       USART_Parity                                                            /*Check and edit it*/
#define _USART_WORDLENGTH   USART_WordLength                                                        /*Check and edit it*/
#define _USART_MODE         USART_Mode                                                              /*Check and edit it*/

#define _USART_SetInit(device)         \
                                USART_Init((_USART_Typedef *)(device->USART_Base),&USART_InitStruct)                /*Check and edit it*/
#define _USART_SENDDATA(data)        \
                                USART_SendData((void*)(device->USART_Base),data);                   /*Check and edit it*/
#define _USART_RECIEVEDATA(device)     \
                                USART_ReceiveData((_USART_Typedef *)(device.USART_Base))            /*Check and edit it*/
/***********************************************************************/
#define _USART_SET_BAUD        (USART_InitStruct._USART_BAUD)
#define _USART_SET_STOP_BITS   (USART_InitStruct._USART_STOP_BITS)
#define _USART_SET_PARITY_BITS (USART_InitStruct._USART_PARITY)
#define _USART_SET_WORDLENGTH  (USART_InitStruct._USART_WORDLENGTH)
#define _USART_SET_MODE        (USART_InitStruct._USART_MODE)
#endif
